package ttestClosed;

import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;

public class TestFrame implements Delayed, Runnable {
	
	private String data;
	private long accTime;
	
	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public long getAccTime() {
		return accTime;
	}

	public void setAccTime(long accTime) {
		this.accTime = accTime;
	}


	public TestFrame(long accTime, String data) {
		this.accTime = accTime + System.currentTimeMillis();
		this.data = data;
	}

	@Override
	public int compareTo(Delayed o) {
		return 0;
	}

	@Override
	public long getDelay(TimeUnit unit) {
		System.out.println(accTime - System.currentTimeMillis());
		return accTime - System.currentTimeMillis();
	}

	@Override
	public void run() {
		System.out.println("Data: " + data);
		
	}

}
